<meta charset="UTF-8">
<?php

include_once("functions/db_manipulate.php");
if (!init()) {
    redirect('Location: login.php');
}

$dialogId = checkDialogCreated($_GET['uid']);

if ($dialogId) {
    redirect("conversation.php?did=" . $dialogId);
} else {
    $newdialogId = createDialog($_GET['uid']);
    redirect("conversation.php?did=" . $newdialogId);
}